﻿<%@ Page Title="" Language="C#" MasterPageFile="~/TsSite.Master" AutoEventWireup="true" CodeBehind="DeactivateSubscription.aspx.cs" Inherits="TireService.Web.View.AdminView.DeactivateSubscription" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <table cellpadding="0" cellspacing="2" border="0">
        <tr>
            <td>
                <img id="imgSubscription" alt="" src="~/Images/Medium/date-time.png" runat="server" style="width: 32px; height: 32px" />
            </td>
            <td valign="middle">
                <h3><asp:Label ID="lblSubscriptionListHeader" runat="server" Text="Deaktivering af abonnement"></asp:Label></h3>
            </td>
            <td>
                <asp:UpdatePanel ID="upMessage" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table border="0" cellspacing="0" cellpadding="5">
                            <tr>
                                <td>
                                    <div style="font-family: Tahoma; font-size: 9pt; font-weight: normal; color: #f15e34">
                                        &nbsp;<asp:Literal ID="lMessage" runat="server"></asp:Literal>
                                    </div>
                                </td>
                            </tr>
                        </table>          
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <hr />
    <asp:Panel runat="server" ID="pSubscriptionSelection" Visible="false">
        <!-- Javascript for Subscription Selection -->
        <script language="javascript" type="text/javascript">

            // Function that handles selection of subscription
            function SubscriptionSelectedClicked() {

                // Get selected customer subscription
                var id = txtSelectCustomerSubscriptionId.GetText();

                if (id != null && id != 0) {

                    // Redirect to this page again
                    location.replace('DeactivateSubscription.aspx?CustomerSubscriptionId=' + id);                   
                }
                else {
                    alert('Intet abonnement valgt');
                }
            }

            function ShowCustomerSubscriptionPopupSearch() {
                pcCustomerSubscriptionSearch.Show();
            }

            function SearchPickCustomerSubscriptionId() {
                pcCustomerSubscriptionSearch.Hide();
            }

        </script>

        <h4>Vælg abonnement</h4>
        <b>Eksempel: 100137-1-34 -> 34 er abonnement nr. (100137 er kunde nr og 1 er abonnementtype id)</b>
        <table>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblSelectCustomerSubscriptionId" runat="server" Text="Abonnement nr">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxTextBox ID="txtSelectCustomerSubscriptionId" ClientInstanceName="txtSelectCustomerSubscriptionId" runat="server" Width="100px">
                        <ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Venligst udfyld abonnement nr" ValidationGroup="SelectCustomerSubscription" SetFocusOnError="true"></ValidationSettings>
                    </dx:ASPxTextBox>
                </td>
                <td>
                    <dx:ASPxButton ID="btnShowSubscriptionSelectionPopup" ToolTip="Klik for at åbne abonnement søge vindue" runat="server" Text="..." AutoPostBack="False" UseSubmitBehavior="False">
                        <ClientSideEvents Click="function(s, e) { ShowCustomerSubscriptionPopupSearch(); }" />
                    </dx:ASPxButton>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <dx:ASPxButton ID="btnSelectCustomerSubscriptionId" runat="server" Text="Udfør" AutoPostBack="False" UseSubmitBehavior="False">
                        <ClientSideEvents Click="function(s, e) { SubscriptionSelectedClicked(); }" />
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>

        <!-- Modalpopup: CustomerSubscriptionSearch forms -->
        <dx:ASPxPopupControl ID="pcCustomerSubscriptionSearch" Modal="false" runat="server" Height="1px" AutoUpdatePosition="true"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" 
            AllowDragging="True" ClientInstanceName="pcCustomerSubscriptionSearch" Left="200" Top="200"
            CloseAction="CloseButton" Width="153px" HeaderText="Noter">
            <ContentCollection>
                <dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server">
                    
                    Ikke implementeret endnu :-(<br /><br />

                    <dx:ASPxButton ID="btnSearchCustomerSubscriptionId" runat="server" Text="Vælg" AutoPostBack="False" UseSubmitBehavior="False">
                        <ClientSideEvents Click="function(s, e) { SearchPickCustomerSubscriptionId(); }" />
                    </dx:ASPxButton>

                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxPopupControl>

    </asp:Panel>


    <asp:Panel runat="server" ID="pDeactivateSubscription" Visible="false">
        <h4>Abonnement</h4>
        <dx:ASPxLabel ID="lblSubscriptionString" runat="server" Text="">
        </dx:ASPxLabel>
        
        <h4>Kundedata</h4>
        <table>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCustomerName" runat="server" Text="Navn">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblCustomerNameValue" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCustomerAddress" runat="server" Text="Addresse">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblCustomerAddressValue" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCustomerZipCodeCity" runat="server" Text="Postnr - By">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblCustomerZipCodeCityValue" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCustomerEmail" runat="server" Text="Email">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblCustomerEmailValue" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
        </table>
        <h4>Abonnement</h4>
        <table>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCustomerSubscriptionId" runat="server" Text="Id">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblCustomerSubscriptionIdValue" ClientInstanceName="lblCustomerSubscriptionIdValue" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblSubscription" runat="server" Text="Abonnement">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblSubscriptionValue" ClientInstanceName="lblSubscriptionValue" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCar" runat="server" Text="Bil(er)">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxLabel ID="lblCarValue" ClientInstanceName="lblCarValue" runat="server" Text="">
                    </dx:ASPxLabel>
                    <br />
                    <dx:ASPxLabel ID="lblCarValue2" ClientInstanceName="lblCarValue2" runat="server" Text="">
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblDeactivationNote" runat="server" Text="Note til deaktivering">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxTextBox ID="txtDeactivationNote" runat="server" Width="170px">
                    </dx:ASPxTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblSendEmail" runat="server" Text="Send email til kunde">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxCheckBox ID="cbDeactivateSubscriptionSendEmail" ClientInstanceName="chDeactivateSubscriptionSendEmail" runat="server">
                    </dx:ASPxCheckBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblReleaseTireSetFromContainer" runat="server" Text="Frigør/udlever dæk fra lager">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxCheckBox ID="cbReleaseTireSetFromContainer" ClientInstanceName="cbReleaseTireSetFromContainer" runat="server" Checked="true">
                    </dx:ASPxCheckBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblCompleteOpenServiceSchedules" runat="server" Text="Angiv åbne service kørsler som afsluttet">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxCheckBox ID="cbCompleteOpenServiceSchedules" ClientInstanceName="cbCompleteOpenServiceSchedules" runat="server" Checked="true">
                    </dx:ASPxCheckBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxLabel ID="lblReceiptTireSet" runat="server" Text="Kvittering på udlevering af hjul?">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxCheckBox ID="cbReceiptTireSet" ClientInstanceName="cbReceiptTireSet" runat="server">
                    </dx:ASPxCheckBox>
                </td>
            </tr>
            <tr>
                <td>
                    <dx:ASPxButton ID="btnResetDeactivation" runat="server" Text="Annuller" 
                        onclick="btnResetDeactivation_Click">
                    </dx:ASPxButton>    
                </td>
                <td>
                    <dx:ASPxButton ID="btnDeactivateSubscription" runat="server" 
                        Text="Deaktiver" onclick="btnDeactivateSubscription_Click">
                    </dx:ASPxButton>    
                </td>
            </tr>        
        </table>
    </asp:Panel>

</asp:Content>
